
package com.xiaoyu.awakening.ai.evaluation.config;

import lombok.SneakyThrows;
import lombok.extern.log4j.Log4j2;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.Resource;

import java.nio.charset.Charset;

/**
 * dataset generate agent
 *
 * @author wangxiaoyu
 * @date 2025/6/10 13:55
 * @since v1.0
 */
@Configuration
@Log4j2
public class AgentsConfiguration {

    /**
     * TODO The prompt is beta.
     */
    @Value("classpath:prompts/datasetGenerate.md")
    private Resource datasetGeneratePrompt;

    @SneakyThrows
    @Bean
    public ChatClient datasetGenerateAgent(ChatClient.Builder chatClientBuilder) {
        log.info("init spring-ai datasetGenerateAgent success!");
        return chatClientBuilder.defaultSystem(datasetGeneratePrompt.getContentAsString(Charset.defaultCharset()))
                .build();
    }

}
